<?php

namespace App\Http\Resources;

use App\Models\Plan;
use Illuminate\Http\Resources\Json\ResourceCollection;

class PlanCollectionResource extends ResourceCollection
{
    public $collects = Plan::class;

    /**
     * @param $request
     * @return array|\Illuminate\Support\Collection
     */
    public function toArray($request)
    {
        return $this->collection->map(function ($plan) {
            return new PlanResource($plan);
        });
    }
}
